package priv.dajie.tzzq.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import priv.dajie.tzzq.dao.ScanCacheMapper;
import priv.dajie.tzzq.model.ScanCacheItem;
import priv.dajie.tzzq.service.ScanCacheService;

import java.util.Date;

/**
 * @ClassName ScanCacheImpl
 * @Description
 * @Author dajie
 * @Date 2019/10/24 12:42 上午
 * @Version V1.0
 **/

@Service
public class ScanCacheServiceImpl implements ScanCacheService {
    @Autowired
    private ScanCacheMapper scanCacheMapper;

    @Override
    public ScanCacheItem getScanCacheItem(String steamName) {
        return scanCacheMapper.getScanCacheItem(steamName);
    }

    @Override
    public boolean addScanCacheItem(ScanCacheItem scanCacheItem) {
        boolean state = scanCacheMapper.updateScanCacheItem(scanCacheItem);
        if (!state){
            state = scanCacheMapper.addScanCacheItem(scanCacheItem);
        }
        return state;

    }

}
